/*
 * @Author: your name
 * @Date: 2022-02-28 10:09:54
 * @LastEditTime: 2022-02-28 10:27:23
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \JS\day02\6-构造函数的方法.js
 */
//Array.from 将类数组对象方法转换为数组
//length 1 2 3
//字符串就是一个类数组对象
var str='string';
console.log(str.length);
for(let index in str){
    console.log(index,str[index]);
}
var result=Array.from(str)
console.log(result,'将类数组对象方法转换为数组');

/* var result1=array.from(str)
console.log(result1,'实例方法不可以调用from方法'); */

//判断是否是一个数组对象 isArray  返回值是boolean类型的true or false
var result1=Array.isArray(str);

console.log(result1);
console.log(Array.isArray([1,2,3,4]),'数组');
console.log(Array.isArray(function(){}),'函数');

console.log(Array.isArray({age:12}),'对象');

console.log(Array.isArray(12),'整数');


